package com.ctshk.rpc.order.goods.service.impl;

import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ctshk.common.dto.Result;
import com.ctshk.common.utils.EntityUtil;
import com.ctshk.rpc.order.goods.dto.ShoppingshopDTO;
import com.ctshk.rpc.order.goods.entity.ShoppingShop;
import com.ctshk.rpc.order.goods.mapper.ShoppingShopMapper;
import com.ctshk.rpc.order.goods.service.IShoppingShopService;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @ClassName ShoppingShopServiceImpl
 * <p>
 *
 * </p>
 * @Author 黄利斌
 * @Date 2021/6/28 2:36 下午
 * @Version 1.0
 **/
@Slf4j
@DubboService
public class ShoppingShopServiceImpl extends ServiceImpl<ShoppingShopMapper, ShoppingShop> implements IShoppingShopService {

    @Autowired
    private ShoppingShopMapper shoppingShopMapper;

    @Override
    public Result<ShoppingshopDTO> info() {
        log.info("【中旅商城--app--获取商城信息--start】");
        ShoppingShop shoppingShop = shoppingShopMapper.selectShopById();
        ShoppingshopDTO shoppingshopDTO = EntityUtil.copy(shoppingShop,ShoppingshopDTO.class);
        log.info("【中旅商城--app--获取商城信息--end】，返参为：{}", JSON.toJSONString(shoppingshopDTO));
        return Result.success(shoppingshopDTO);
    }
}
